package cn.ondraw.ragflow.pojo.response;

import lombok.Data;
import java.util.List;

/**
 * 列出聊天助手的响应对象
 */
@Data
public class ListChatAssistantResponse {
    /**
     * 响应代码
     */
    private Integer code;
    /**
     * 聊天助手列表数据
     */
    private List<DataInfo> data;

    /**
     * 聊天助手数据的内部类
     */
    @Data
    public static class DataInfo {
        /**
         * 头像的 Base64 编码
         */
        private String avatar;
        /**
         * 创建日期
         */
        private String create_date;
        /**
         * 创建时间戳
         */
        private Long create_time;
        /**
         * 关联数据集列表
         */
        private List<Dataset> datasets;
        /**
         * 描述信息
         */
        private String description;
        /**
         * 是否参考
         */
        private String do_refer;
        /**
         * 聊天助手的 ID
         */
        private String id;
        /**
         * 语言
         */
        private String language;
        /**
         * 聊天助手的大语言模型设置
         */
        private LLM llm;
        /**
         * 聊天助手的名称
         */
        private String name;
        /**
         * 大语言模型遵循的指令
         */
        private Prompt prompt;
        /**
         * 提示类型
         */
        private String prompt_type;
        /**
         * 状态
         */
        private String status;
        /**
         * 租户 ID
         */
        private String tenant_id;
        /**
         * 基于特定排名标准对列表或集合中的前 k 个项目进行重新排序或选择，默认值 1024
         */
        private Integer top_k;
        /**
         * 更新日期
         */
        private String update_date;
        /**
         * 更新时间戳
         */
        private Long update_time;
    }

    /**
     * 数据集内部类
     */
    @Data
    public static class Dataset {
        private String avatar;
        private Integer chunk_num;
        private String create_date;
        private Long create_time;
        private String created_by;
        private String description;
        private Integer doc_num;
        private String embd_id;
        private String id;
        private String language;
        private String name;
        private Integer pagerank;
        private ParserConfig parser_config;
        private String parser_id;
        private String permission;
        private Double similarity_threshold;
        private String status;
        private String tenant_id;
        private Integer token_num;
        private String update_date;
        private Long update_time;
        private Double vector_similarity_weight;
    }

    /**
     * 解析配置内部类
     */
    @Data
    public static class ParserConfig {
        private Integer auto_keywords;
        private Integer auto_questions;
        private Integer chunk_token_num;
        private String delimiter;
        private Graphrag graphrag;
        private Boolean html4excel;
        private String layout_recognize;
        private Raptor raptor;
    }

    /**
     * Graphrag 内部类
     */
    @Data
    public static class Graphrag {
        private Boolean use_graphrag;
    }

    /**
     * Raptor 内部类
     */
    @Data
    public static class Raptor {
        private Boolean use_raptor;
    }

    /**
     * 大语言模型设置内部类
     */
    @Data
    public static class LLM {
        private Double frequency_penalty;
        private String model_name;
        private Double presence_penalty;
        private Double temperature;
        private Double top_p;
    }

    /**
     * 提示内部类
     */
    @Data
    public static class Prompt {
        private String empty_response;
        private Double keywords_similarity_weight;
        private String opener;
        private String prompt;
        private Boolean refine_multiturn;
        private String rerank_model;
        private Boolean show_quote;
        private Double similarity_threshold;
        private Integer top_n;
        private Boolean tts;
        private List<Variable> variables;
    }

    /**
     * 变量内部类
     */
    @Data
    public static class Variable {
        private String key;
        private Boolean optional;
    }
}
